package com.example.demo;

import com.example.demo.annotions.WebPath;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 *
 * @author Arat.Wu
 * @date 2018/10/08
 */
@Service
public class ServiceApp {
    private JavaConfig javaConfig;

    @Autowired
    public ServiceApp(JavaConfig javaConfig) {
        this.javaConfig = javaConfig;
    }

    @Bean
    public HashMap hashMapApp(){
        HashMap hashMap = new HashMap();
        hashMap.put("info",javaConfig.info);

        return hashMap;
    }

    @WebPath
    public JavaConfig.Student student(Long id){
        return JavaConfig.Student.builder().id(id).build();
    }
}
